<template>
  <CommonBox title="闲置资产列表" width="546px">
    <div class="list-container">
      <div class="no-list" v-if="leaveAssetsList.length == 0">
        <img src="@/assets/img/nodata.png" alt="" />
      </div>
      <div class="have-list" v-else>
        <div class="list-header">
          <div class="header-text">资产编号</div>
          <div class="header-text">资产名称</div>
          <div class="header-text">类型</div>
          <div class="header-text">备注</div>
        </div>
        <div class="print-item" v-for="item in leaveAssetsList">
          <div class="item-text">{{ item.zcbhx }}</div>
          <div class="item-text">{{ type[item.zcmcx] || item.zcmc }}</div>
          <div class="item-text">{{ item.xh }}</div>
          <div class="item-text">{{ item.bz }}</div>
        </div>
      </div>
    </div>
  </CommonBox>
</template>

<script setup>
import { type } from "@/lib";
import CommonBox from "../commonBox.vue";
const props = defineProps({
  leaveAssetsList: {
    type: Array,
    default: () => [],
  },
});
</script>

<style scoped lang="less">
.list-container {
  width: 100%;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  border-radius: 12px;

  .no-list {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      width: 256px;
      height: 256px;
    }
  }
  .have-list {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    .list-header {
      width: 100%;
      height: 40px;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      border-bottom: 2px solid #e5e7eb;
      .header-text {
        width: 25%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 16px;
        font-weight: bold;
        color: #000;
      }
    }
    .print-item {
      width: 100%;
      min-height: 40px;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      border-bottom: 2px solid #e5e7eb;
      .item-text {
        width: 25%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 14px;
        font-weight: bold;
        color: #000;
      }
    }
  }
}
</style>
